﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace SocketServer
{
    public partial class NotifyIconWrapper : Component
    {
        public NotifyIconWrapper()
        {
            InitializeComponent();
        }

        public NotifyIconWrapper(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
        }

        private void cmsNotifyicon_ItemClicked(object sender, System.Windows.Forms.ToolStripItemClickedEventArgs e)
        {
            if (e.ClickedItem.Name == "tcmsclose")
            {
                System.Windows.Application.Current.Shutdown();
            }
            else if (e.ClickedItem.Name == "tcmsshow")
            {
                System.Windows.Application.Current.MainWindow.Show();
            }
        }

        private void nfi_MouseDoubleClick(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            System.Windows.Application.Current.MainWindow.Show();
        }
    }
}
